package test.designpattern.simpleFactory;

public class CalculatorFactory {
    public static ICalculator create(String symbol) {
        ICalculator calculator = null;
        switch (symbol) {
            case "+":
                calculator = new Add();
                break;
            case "-":
                calculator = new Sub();
                break;
            case "*":
                calculator = new Mul();
                break;
            case "/":
                calculator = new Div();
                break;
        }
        return calculator;
    }
}
